import java.util.ArrayList;
import java.util.Scanner;


public class ZYTest2{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();

        ArrayList<String> wordsList = new ArrayList<>();
        StringBuilder currentWord = new StringBuilder();

        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (Character.isLetter(c)) {
                currentWord.append(c);
            } else {
                if (currentWord.length() > 0) {
                    wordsList.add(currentWord.toString());
                    currentWord.setLength(0);
                }
            }
        }

        // 处理最后一个单词
        if (currentWord.length() > 0) {
            wordsList.add(currentWord.toString());
        }

        String[] wordsArray = wordsList.toArray(new String[0]);

        for (String word : wordsArray) {
            System.out.println(word);
        }
    }
}